Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linter): eslint-plugin-vitest/require-local-test-context-for-concurrent-snapshots #4578

Conversation

eryue0220
Copy link
Contributor

Copy link

graphite-app bot commented Jul 31, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the A-linter Area - Linter label Jul 31, 2024
Copy link

codspeed-hq bot commented Jul 31, 2024

CodSpeed Performance Report

Merging #4578 will not alter performance

Comparing eryue0220:feat/vitest-require-local-test-context-for-concurrent-snapshots (d2f569c) with main (4dd29db)

Summary

✅ 29 untouched benchmarks

@eryue0220 eryue0220 marked this pull request as draft August 1, 2024 07:27
@eryue0220 eryue0220 marked this pull request as ready for review August 1, 2024 09:25
@eryue0220 eryue0220 marked this pull request as draft August 5, 2024 08:49
@eryue0220 eryue0220 marked this pull request as ready for review August 5, 2024 14:04
Copy link
Contributor

@mysteryven mysteryven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you split the bug fixes in another PR? We are supposed this PR only contains things about require-local-test-context-for-concurrent-snapshots rule.

("testSomething()", None),
("xitSomethingElse()", None),
("xitiViewMap()", None),
("describe('foo', function () {})", None, None, Some(PathBuf::from(jest_path))),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to change test cases in rules, you can update path at once:

let path_to_lint = if self.import_plugin {
      assert!(path.is_none(), "import plugin does not support path");
      self.current_working_directory.join(&self.rule_path)
  } else if let Some(path) = path {
      self.current_working_directory.join(path)
+ } else if self.jest_plugin {
+     self.rule_path.with_extension("test.tsx")
  } else {
      self.rule_path.clone()
  };

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll updated it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@eryue0220 eryue0220 marked this pull request as draft August 6, 2024 10:40
@eryue0220 eryue0220 marked this pull request as ready for review August 9, 2024 14:37
@mysteryven
Copy link
Contributor

This PR looks huge, can you split the bug fixes into another PR?

@eryue0220 eryue0220 closed this Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants